package cn.web.model;

import cn.entity.Comment;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.UUID;

/**
 * @author m on 2023/1/29
 * Description:
 */
@Getter
@Setter
public class VmComment {
    private UUID id;
    private Integer pid;
    private String content;
    private Date createTime;
    private UUID userId;
    private String nickName;
    private UUID articleId;

    public VmComment create(Comment comment,boolean isReply){
        VmComment vm = new VmComment();
        vm.setId(comment.getId());
        vm.setPid(comment.getPid());
        vm.setContent(comment.getContent());
        vm.setCreateTime(comment.getCreateTime());
        vm.setUserId(comment.getUser().getId());
        vm.setNickName(comment.getUser().getNickName());
        vm.setArticleId(comment.getArticle().getId());

        return vm;
    }

}
